<div class="container-fluid" style="margin-top: 10px;">
    <div class="row">
        <form id="inputForm" action="add">
            {:form('text',['title'=>'设备号','value'=>$data.FACILITY_NO,'disable'=>'disabled'])}
            <input hidden name="FACILITY_NO" value="{
            .FACILITY_NO}">
            {:form('date',['title'=>'入账时间','value'=>$data.ENTERTIME,'name'=>'ENTERTIME'])}
            {:form('text',['title'=>'设备名称','value'=>$data.FACILITY,'name'=>'FACILITY'])}
            {:form('select2',['title'=>'设备分类','value'=>$data.FACITYPE_ID,'name'=>'FACITYPE_ID','url'=>'dict/getFacitype','key'=>'FACITYPE_ID','field'=>'FACITYPE'])}
            {:form('select2',['title'=>'使用单位','value'=>$data.DEPART_USE,'name'=>'DEPART_USE','url'=>'dict/getDepartment','key'=>'DEPART_ID','field'=>'DEPART_SHORT'])}
            {:form('select2',['title'=>'国别','value'=>$data.COUNTRY_ID,'name'=>'COUNTRY_ID','url'=>'dict/getCountry','key'=>'ID','field'=>'NAME'])}
            {:form('text',['title'=>'型号','value'=>$data.MODEL,'name'=>'MODEL'])}
            {:form('text',['title'=>'技术指标','value'=>$data.TECH_SPEC,'name'=>'TECH_SPEC'])}
            {:form('text',['title'=>'单价','value'=>$data.PRICE,'name'=>'PRICE'])}
            {:form('text',['title'=>'厂家','value'=>$data.FACTORY,'name'=>'FACTORY'])}
            {:form('date',['title'=>'出厂日期','value'=>$data.OUTFACTORY_DATE,'name'=>'OUTFACTORY_DATE'])}
            {:form('text',['title'=>'出厂号','value'=>$data.OUTFACTORY_NO,'name'=>'OUTFACTORY_NO'])}
            {:form('select2',['title'=>'使用方向','value'=>$data.USEDIRECTION_ID,'name'=>'USEDIRECTION_ID','url'=>'dict/getUseDirection','key'=>'USEDIRECTION_ID','field'=>'USEDIRECTION'])}
            {:form('select2',['title'=>'设备状态','value'=>$data.STATE_ID,'name'=>'STATE_ID','url'=>'dict/getSbState','key'=>'STATE_ID','field'=>'STATE'])}
            {:form('select2',['title'=>'经费科目','value'=>$data.FININ_ID,'name'=>'FININ_ID','url'=>'dict/getFinin','key'=>'FININ_ID','field'=>'FININ'])}
            {:form('text',['title'=>'单据号','value'=>$data.RECEIPT_NO,'name'=>'RECEIPT_NO'])}
            {:form('text',['title'=>'保管人','value'=>$data.PERSON_GET,'name'=>'PERSON_GET'])}
            {:form('text',['title'=>'经办人','value'=>$data.PERSON_THROUGH,'name'=>'PERSON_THROUGH'])}
            <!--{:form('text',['title'=>'室设备管理员','value'=>$data.PERSON_CHECK,'name'=>'PERSON_CHECK'])}-->
            <!--{:form('select2',['title'=>'是否开放','value'=>$data.IS_OPEN,'name'=>'IS_OPEN','url'=>'dict/getFaciOpen','key'=>'ID','field'=>'NAME'])}-->
            <!--{:form('text',['title'=>'详细技术指标','value'=>$data.TECH_SPEC_DETAIL,'name'=>'TECH_SPEC_DETAIL'])}-->
            <!--{:form('text',['title'=>'功能及应用范围','value'=>$data.FUNCTION_USE,'name'=>'FUNCTION_USE'])}-->
            <!--{:form('text',['title'=>'可供开放时间','value'=>$data.OPEN_TIME,'name'=>'OPEN_TIME'])}-->
            <!--{:form('text',['title'=>'收费标准','value'=>$data.FEE_STANDARD,'name'=>'FEE_STANDARD'])}-->
            <!--{:form('text',['title'=>'设备存放地点','value'=>$data.PLACE_STORE,'name'=>'PLACE_STORE'])}-->
            <!--{:form('text',['title'=>'设备负责人','value'=>$data.PERSON_RESPONSE,'name'=>'PERSON_RESPONSE'])}-->
            <!--{:form('text',['title'=>'联系电话','value'=>$data.PHONE,'name'=>'PHONE'])}-->
            <!--{:form('text',['title'=>'电子邮件','value'=>$data.EMAIL,'name'=>'EMAIL'])}-->
            <!--{:form('text',['title'=>'操作员','value'=>$data.OPERATOR,'name'=>'OPERATOR','disable'=>'disabled'])}-->
            <!--{:form('text',['title'=>'录入日期','value'=>$data.INPUTDATE,'name'=>'INPUTDATE','disable'=>'disabled'])}-->
            <!--{:form('text',['title'=>'备注','value'=>$data.COMMENTS,'name'=>'COMMENTS'])}-->
            <!--{:form('select2',['title'=>'隶属单位','value'=>$data.BELONG_ID,'name'=>'BELONG_ID','url'=>'dict/getBelongList','key'=>'BELONG_ID','field'=>'BELONG'])}-->
            <!--{:form('text',['title'=>'设备所属详细科室','value'=>$data.DEPA_PARTICULAR,'name'=>'DEPA_PARTICULAR'])}-->
            <!--{:form('select2',['title'=>'是否免税','value'=>$data.IS_DUTYFREE,'name'=>'IS_DUTYFREE','url'=>'dict/getDutyFree','key'=>'ID','field'=>'NAME'])}-->
            <!--{:form('text',['title'=>'备注2','value'=>$data.COMMENTS2,'name'=>'COMMENTS2'])}-->
            <!--{:form('text',['title'=>'设备备注','value'=>$data.COMMENTS3,'name'=>'COMMENTS3'])}-->
            <!--{:form('text',['title'=>'海关编号','value'=>$data.F_CIQ_NO,'name'=>'F_CIQ_NO'])}-->
        </form>
        <div class="col-sm-12" style="margin-top: 10px;text-align: center">
            <button id="addButton" class="btn btn-info">新增</button>
        </div>
    </div>
</div>

<script>

    $(function () {
        $("#addButton").on('click',function () {
            layer.confirm('确认新增设备吗？',function (index) {
                layer.close(index);
                layer.load();
                $("#inputForm").ajaxSubmit(function (text) {
                    console.log(text);
                    layer.closeAll('loading');
                    var json = JSON.parse(text);
                    if(json['code'] == '200'){
                        layer.alert(json['msg'],{icon:1},function (index) {
                            layer.close(index);
                            parent.location.reload();
                        })
                    }
                    else{
                        layer.alert(json['msg'],{icon:2});
                    }
                });
            });
        });
    });

</script>